<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改商城订单')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-mallOrder-edit" th:object="${webMallUserOrder}">
        <h4 class="form-header h4">订单信息</h4>
        <input name="id" th:field="*{id}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">用户：</label>
            <div class="col-sm-8 form-control-static" >
                [[${user.nickname}]] - [[${user.mobile}]]
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">订单号：</label>
            <div class="col-sm-8 form-control-static" th:text="*{orderNo}">
            </div>
        </div>
        <!--<div class="form-group">
            <label class="col-sm-3 control-label is-required">订单数量：</label>
            <div class="col-sm-8 form-control-static" th:text="*{orderSum}">
            </div>
        </div>-->
        <!--<div class="form-group">
            <label class="col-sm-3 control-label is-required">邮费：</label>
            <div class="col-sm-8">
                <input name="orderCost" th:field="*{orderCost}" class="form-control" type="text" required>
            </div>
        </div>-->
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">订单总额：</label>
            <div class="col-sm-8 form-control-static" th:text="*{orderAmount}">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label is-required">待付款金额：</label>
            <div class="col-sm-8">
                <input name="waitPayMoney" th:field="*{waitPayMoney}" class="form-control number" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">积分抵扣数：</label>
            <div class="col-sm-8 form-control-static" th:text="*{useScoreSum}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">订单状态</label>
            <div class="col-sm-8">
                <select name="orderStatus" class="form-control m-b" >
                    <option th:each="dict : ${@dict.getType('mall_order_status')}" th:value="${dict.dictValue}" th:text="${dict.dictLabel}" th:field="*{orderStatus}"></option>
                </select>
               <!-- <div class="radio-box" th:each="dict : ${@dict.getType('mall_order_status')}">

                    <input type="radio" th:id="${'orderStatus_' + dict.dictCode}" name="orderStatus" th:value="${dict.dictValue}" th:field="*{orderStatus}" required>
                    <label th:for="${'orderStatus_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                </div>-->
            </div>
        </div>
        <div class="form-group" th:if="*{payStatus ==1}">
            <label class="col-sm-3 control-label is-required">支付状态：</label>
            <div class="col-sm-8">
                <div class="radio-box" th:each="dict : ${@dict.getType('number_yesno')}">
                    <input type="radio" th:id="${'payStatus_' + dict.dictCode}" name="payStatus" th:value="${dict.dictValue}" th:field="*{payStatus}" disabled>
                    <label th:for="${'payStatus_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                </div>
            </div>
        </div>
        <div class="form-group" th:if="*{payStatus ==1}">
            <label class="col-sm-3 control-label">支付金额：</label>
            <div class="col-sm-8 form-control-static" th:text="*{payMoney}">
            </div>
        </div>
        <div class="form-group" th:if="*{payStatus ==1}">
            <label class="col-sm-3 control-label">第三方支付订单号：</label>
            <div class="col-sm-8 form-control-static" th:text="*{tradeNo}">
            </div>
        </div>
        <div class="form-group" th:if="*{payStatus ==1}">
            <label class="col-sm-3 control-label">支付号：</label>
            <div class="col-sm-8 form-control-static" th:text="*{payNo}">
            </div>
        </div>
        <div class="form-group" th:if="*{payStatus ==1}">
            <label class="col-sm-3 control-label">支付时间：</label>
            <div class="col-sm-8 form-control-static" th:text="*{payTime}">
            </div>
        </div>

        <!--<div class="form-group">
            <label class="col-sm-3 control-label is-required">退款状态：</label>
            <div class="col-sm-8">
                <div class="radio-box" th:each="dict : ${@dict.getType('mall_order_return_status')}">
                    <input type="radio" th:id="${'returnStatus_' + dict.dictCode}" name="returnStatus" th:value="${dict.dictValue}" th:field="*{returnStatus}" disabled>
                    <label th:for="${'returnStatus_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                </div>
            </div>
        </div>-->

        <div class="form-group">
            <label class="col-sm-3 control-label">订单联系人：</label>
            <div class="col-sm-8">
                <input name="orderLinkName" th:field="*{orderLinkName}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">联系人电话：</label>
            <div class="col-sm-8">
                <input name="orderLinkMobile" th:field="*{orderLinkMobile}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">联系人地址：</label>
            <div class="col-sm-8">
                <input name="orderlLinkAddress" th:field="*{orderlLinkAddress}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">快递单号：</label>
            <div class="col-sm-8">
                <input name="expressNo" th:field="*{expressNo}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">快递公司：</label>
            <div class="col-sm-8">
                <input name="expressName" th:field="*{expressName}" class="form-control" type="text">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">备注：</label>
            <div class="col-sm-8">
                <input name="comment" th:field="*{comment}" class="form-control" type="text">
            </div>
        </div>

        <h4 class="form-header h4">产品信息</h4>
        <div th:each="item:${listProduct}">
            <div class="row" >
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required">产品名称：</label>
                        <div class="col-sm-8 form-control-static" th:text="${item.productName}">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">数量：</label>
                        <div class="col-sm-8 form-control-static" th:text="${item.number}">
                        </div>
                    </div>
                </div>
            </div>
            <div class="row" >
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required">价格：</label>
                        <div class="col-sm-8 form-control-static" th:text="${item.price}">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">SKU：</label>
                        <div class="col-sm-8 form-control-static" th:text="${item.sku}">
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>

    <div class="row">
        <div class="col-sm-offset-5 col-sm-10">
            <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
            <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
        </div>
    </div>
</div>

<th:block th:include="include :: footer" />
<script th:inline="javascript">
        var prefix = ctx + "system/mallOrder";
        $("#form-mallOrder-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.saveTab(prefix + "/edit", $('#form-mallOrder-edit').serialize());
            }
        }
    </script>
</body>
</html>